package csvm_v1.coins;

/**
 * Dime adalah kelas konkrit turunan dari Coin. Dime bernilai 10, dengan
 * keterangan dimensi seperti yang tertera pada kelas.
 *
 * @author Muqtafi Akhmad
 */
public class Dime extends Coin {

    /**
     * ukuran koin Dime
     */
    private static final float dimeSize = (float) 17.91;
    /**
     * berat koin Dime
     */
    private static final float dimeWeight = (float) 2.268;
    /**
     * ketebalan koin Dime
     */
    private static final float dimeThickness = (float) 1.35;
    /**
     * keterangan apakah koin Dime bergerigi
     */
    private static final boolean dimeIsSerratedEdge = true;
    /**
     * nilai koin Dime
     */
    private static final int dimeValue = 10;

    /**
     * konstruktor dari Dime
     */
    public Dime() {
        super(dimeSize, dimeWeight, dimeThickness, dimeIsSerratedEdge, dimeValue);
    }

    /**
     * mendeteksi apakah objek yang dimasukkan adalah koin Dime
     *
     * @param size ukuran
     * @param weight berat
     * @param thickness ketebalan
     * @param isSerratedEdge keterangan bergerigi
     * @return apakah Dime
     */
    public static boolean isDime(float size, float weight, float thickness, boolean isSerratedEdge) {
        return (Math.abs(size - dimeSize) < dimensionTolerance * dimeSize) && (Math.abs(weight - dimeWeight) < dimensionTolerance * dimeWeight) && (Math.abs(thickness - dimeThickness) < dimensionTolerance * dimeThickness) && isSerratedEdge == dimeIsSerratedEdge;
    }
    
    @Override
    public String getCoinName() {
        return "Dime";
    }
}
